import {
  createRouter,
  createWebHashHistory,
  type RouteRecordRaw,
} from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/home",
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("@/views/home.vue"),
    meta: {
      title: "首页",
    },
    children: [],
  },
  {
    path: "/news",
    name: "News",
    component: () => import("@/views/info/index.vue"),
    meta: {
      title: "新闻",
    },
    children: [],
  },
  {
    path: "/newsList",
    name: "NewsList",
    component: () => import("@/views/info/newsList.vue"),
    meta: {
      title: "新闻列表",
    },
    children: [],
  },
  {
    path: "/info",
    name: "Info",
    component: () => import("@/views/info/items.vue"),
    meta: {
      title: "详情",
    },
    children: [],
  },
  {
    path: "/teaching",
    name: "Teaching",
    component: () => import("@/views/teaching/index.vue"),
    meta: {
      title: "详情",
    },
    children: [],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
